<template>
	<view>
		<view class="my-search-container" :style="{ 'background-color':bgColor }">
			<view class="my-search-box" :style="{ 'border-radius':bRadius + 'px' }" @click="searchHandler">
				<!-- 使用 uni-ui 提供的图标组件 -->
				<uni-icons type="search" :size="18"></uni-icons>
				<text class="placeholder">搜索</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		props:{
			// 背景颜色
			bgColor:{
				type:String,
				default:'#C00000'
			},
			// 圆角尺寸
			bRadius:{
				type:Number,
				// 单位 px
				default:18
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			searchHandler(){
				this.$emit('searchEvent')
			}
		}

	}
</script>

<style lang="scss">
.my-search-container{
	display: flex;
	align-items: center;
	height: 50px;
	// background-color: #C00000;
	padding:0 10px;
	.my-search-box{
		width: 100%;
		height: 36px;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #FFFFFF;
		// border-radius: 18px;
		.placeholder{
			font-size: 14px;
			margin-left: 5px;
		}
		
	}
}
</style>